package com.youbest.cloud.javacore.clazz;

import java.text.SimpleDateFormat;
import java.util.Date;

public class MyDate extends Date{
	private static final long serialVersionUID = -6970360594037466441L;

	
	@Override
	public String toString() {
		SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss E");
		return df.format(this);		
	}
	
	public String toYyyyMmdd() {
		SimpleDateFormat df = new SimpleDateFormat("yyyyMMdd");
		return df.format(this);	
	}
	
	public String toHHmmss() {
		SimpleDateFormat df = new SimpleDateFormat("HHmmss");
		return df.format(this);	
	}
	
	public static void main(String[] args) {
		MyDate d = new MyDate();
		System.out.println(d);
		System.out.println(d.toYyyyMmdd());
		System.out.println(d.toHHmmss());
	}
	
}
